diff --git a/astropy/units/core.py b/astropy/units/core.py
index e9bd986d33..1b202395e9 100644
--- a/astropy/units/core.py
+++ b/astropy/units/core.py
@@ -1710,6 +1710,8 @@ class UnrecognizedUnit(IrreducibleUnit):
         _unrecognized_operator
 
     def __eq__(self, other):
+        if other is None:
+            return False
         other = Unit(other, parse_strict='silent')
         return isinstance(other, UnrecognizedUnit) and self.name == other.name
 
